package controllers

import (
	//"fmt"
	"time"
	"github.com/gin-gonic/gin"

	"huaxrobot/services"
)




func RecordListGet(c *gin.Context) {	
	records := services.RecordListGet()
	c.JSON(200, records)
}

func RecordGet(c *gin.Context) {	
	dateFind := c.Param("date")
	if dateFind == "" {
		dateFind = time.Now().Format("2006-01-02")
	}
	record := services.RecordGet(dateFind)
	c.JSON(200, record)
}